﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BLL.Service;
using BLL.Model;

namespace BLL.Action
{
    /// <summary>
    /// 通讯部分用户操作
    /// </summary>
    public class User
    {
        public string rel = "无效指令";

        /// <summary>
        /// 用户登录验证
        /// </summary>
        /// <param name="no">格式：{1}用户名|{2}密码</param>
        /// <returns></returns>
        public bool userLogin(string no,string ip)
        {
            userModel userM = new userModel();
            userService user = new userService();

            string[] noStr=new string[2];
            noStr = no.Split('|');

            if(noStr.Length!=2){
                rel = "登录信息格式出错！";
                return false;
            }

            if (user.UserLogin(noStr[0], noStr[1],terminalService.htSeatIp[ip].ToString()))
            {
                return true;
            }
            else
            {
                rel = "登录失败,请重新登录！";
                return false;
            }
        }
    }
}
